package com.dashboard.dto
{
	import flash.net.URLLoader;
	import flash.net.URLRequest;
	
	import mx.rpc.events.FaultEvent;
	import mx.rpc.events.ResultEvent;
	import mx.rpc.http.HTTPService;
	[Bindable]
	public class applicationConstants
	{
		/* public static var objPersonalization:Personalization; */
		public var userid:int;
		public var voxURL:String;
		public var podMessage:String;
		public var isDisconnected:String;
		public var isdebugmode:String;
		public var welcomeMessage:String;
		public var imgPath:String;
		public var isPersonalized:String;
		public var defaultLayoutViewType:String;
		public var Timerinterval:int;
		public var TimerEnabled:String;
		public var copyrightEnabled:String;
        public var copyright:String;
		
		public function applicationConstants()
		{
            var httpService:HTTPService  = new HTTPService();		
		    httpService.url = "data/config.xml";
			httpService.resultFormat = "e4x";
			httpService.addEventListener(FaultEvent.FAULT, onMenuFaultHttpService);
			httpService.addEventListener(ResultEvent.RESULT, onMenuResultHttpService);
			httpService.send();
			
		}
		
		private function onMenuResultHttpService(e:ResultEvent):void
		{
			this.voxURL = e.result.dgvoxserver.@endPointURL;
			this.podMessage = e.result.pod.@text;
			this.isDisconnected = e.result.DisconnectedMode.@value;
			this.welcomeMessage = e.result.main.@text;
			this.isdebugmode = e.result.DebugMode.@value;
			this.imgPath = e.result.imgPath.@URL;
			this.isPersonalized = e.result.Personalization.@value;
			this.defaultLayoutViewType = e.result.DefaultLayoutViewType.@value;
			this.Timerinterval = e.result.Timerinterval.@value;
			this.TimerEnabled = e.result.Timerinterval.@TimerEnabled;
			this.copyright = e.result.copyright.@value;
   			this.copyrightEnabled = e.result.copyright.@Enabled;
		}
		private function onMenuFaultHttpService(e:FaultEvent):void
		{
			//Alert.show("Unable to load data/pods.xml.");
		}
	}
}